package com.woniuxy.creditsystem.common.mapper;

import com.woniuxy.creditsystem.common.bean.DataDictionaryInfo;
import com.woniuxy.creditsystem.common.bean.PageRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 数据字典mapper
 * @author liaojian
 * */
import org.apache.ibatis.annotations.Select;



@Mapper
public interface DataDictionaryMapper {

    /**
     * 通过数据字典类型查询名字
     * @Param 数据字典类型
     * @Authod liaojian
     * */
    List<DataDictionaryInfo> findByDicType(@Param("type") String dicType);

    /**
     * 分页查询
     * @Author liaojian
     * */
    List<DataDictionaryInfo> findAllByParams(
            @Param("p") PageRequest request, @Param("d") DataDictionaryInfo data);
     /** 查询所有数据
     * @author liaojian
      */

    @Select("select id,number,dic_type as dicType from data_dictionary_info")
    List<DataDictionaryInfo> findAll();

    /**
     * 新增数据
     * @Author liaojian
     * */
    int save(@Param("d") DataDictionaryInfo data);

    /**
     * 修改数据
     * @Author liaojian
     * */
    int update(@Param("d") DataDictionaryInfo data);

    /**
     * 删除数据
     * */
    int delete(long id);
}
